using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyBullet : Bullet
{
    public override void OnHitPlayer(PlayerControl playerControl)
    {
        base.OnHitPlayer(playerControl);
        GameMgr.Get<IPlayerManager>().Damage(bulletData.Damage, new DamageArgs() { directionAngle = transform.rotation.z - 90, source = transform.position });
        OnDestory();
    }

    public override void OnHitGround(Vector2 normal)
    {
        base.OnHitGround(normal);
        OnDestory();
    }

    public override void OnHitTrain(TrainBody train)
    {
        base.OnHitTrain(train);
        GameMgr.Get<ITrainManager>().Damage(train, bulletData.Damage);
        OnDestory();
    }
}
